package designpattern.builder.staticClass;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 刘牌
 * @Date: 2021/12/15/12:48
 * @Description:
 */
public class Student {
    private String no;
    private String name;
    private Integer sex;
    private Float score;

    public static class StudentBuilder{
        Student student = new Student();

        public StudentBuilder setNo(String no){
            student.setNo(no);
            return this;
        }

        public StudentBuilder setName(String name){
            student.setName(name);
            return this;
        }

        public StudentBuilder setSex(Integer sex){
            student.setSex(sex);
            return this;
        }

        public StudentBuilder setScore(Float score){
            student.setScore(score);
            return this;
        }

        public Student build(){
            return student;
        }
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Float getScore() {
        return score;
    }

    public void setScore(Float score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "no='" + no + '\'' +
                ", name='" + name + '\'' +
                ", sex=" + sex +
                ", score=" + score +
                '}';
    }
}
